﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ZH.GPT.Infrastructures.Entities;

namespace ZH.GPT.Infrastructures.Configurations
{
    public class ChatConfiguration : IEntityTypeConfiguration<Chat>
    {
        public void Configure(EntityTypeBuilder<Chat> builder)
        {
            builder.ToTable("chat");

            builder.HasComment("gpt聊天")
                .HasCharSet("utf8")
                .UseCollation("utf8_general_ci");

            builder.Property(e => e.Id)
                .HasColumnName("id")
                .HasComment("id");

            builder.Property(e => e.UserId)
                .HasColumnName("user_id")
                .HasComment("用户id");

            builder.Property(e => e.Description)
             .HasColumnName("description")
             .HasComment("描述");

            builder.Property(e => e.CreatedTime)
             .HasColumnName("created_time")
             .HasComment("创建时间");

            builder.Property(e => e.ModifiedTime)
             .HasColumnName("modified_time")
             .HasComment("更新时间");

            builder.Property(e => e.Role)
            .HasColumnName("role")
            .HasComment("扮演角色");

            builder.Property(e => e.Model)
           .HasColumnName("model")
           .HasComment("gpt模型");
        }
    }
}
